#ifndef DATABASEINTERFACE_H
#define DATABASEINTERFACE_H

#include <QObject>
#include <QSqlRecord>
#include <QSqlQuery>
#include <QDebug>
#include <QVector>
#include "databasequeue.h"
#include "person.h"
#include "login.h"
#include "curriculum.h"

class DatabaseInterface : public QObject
{
    Q_OBJECT
private:
    explicit DatabaseInterface();
public:

    static DatabaseInterface* Insterce();

    void log(QString userid,QString pwd);
    bool getPasswordPair();

    void persondata(QString userid);
    Person* getpersondata();

    void setPersondata(QString id,QString phone,QString email);

    void setLocal(QString id,QString pwd);
    void seachLocal();
    Login* getLocal();

    void setChangedPasswod(QString pwd,QString id);

    QVector<Curriculum> setCurriculum();
    QVector<Curriculum> getCurriculum();

    void joinCurriculum(int user_id,int cur_id);

    void isSelectCur(int user_id,int cur_id);
    bool getIsSelectCur();

    void setMyCurriculum(int user_id);
    QVector<Curriculum> getMyCurriculum();

private:
    bool                        passwordpair;
    Person*                     m_persondata;
    Login*                      m_local;
    QVector<Curriculum>         m_curriculum;
    QVector<Curriculum>         m_mycurriculum;
    bool                        is_SelectCur;
};

#endif // DATABASEINTERFACE_H
